<%@ page language="java" import="java.util.*,com.hs.core.utils.*,com.hs.chd.action.search.*" pageEncoding="utf-8"%>
<%
Map datamap = (Map)request.getAttribute("datamap");
String  yearbuffer = (String)request.getAttribute("yearbuffer");
 
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head> 
<%@ include file="../../include.jsp"%> 
<script src='<%=basePath%>thirtpart/jquery/jquery.blockUI.js'></script> 
<script src='<%=basePath%>app/js/search.js'></script> 
<script src="<%=basePath %>app/js/nav.js"></script> 
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/highcharts.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/modules/exporting.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/app/js/stat.js"></script>
<style>.tac{text-align:center}</style>
<script language=JavaScript>  
      
      
function simpleCaseSearch(condition){ 
	simpleSearch(condition,'<%=basePath%>');
}
function comflexCaseSearch(condition){ 
	comflexSearch(condition,'<%=basePath%>');
}
</script>
<style type="text/css">


</style>
</head> 
    <div class="content" id="container" style="width: 99%; height: 90%; margin: 0 auto">
    	 
    </div> 
</body>
</html>
<script type="text/javascript">
<!--
 

var chart;
$(document).ready(function() {
	chart = new Highcharts.Chart({
		chart: {
			renderTo: 'container',
			defaultSeriesType: 'line'
		},
		title: {
			text: '中药使用前十名趋势统计'
		},
		subtitle: {
			text: ''
		},
		xAxis: {
			categories: [<%=yearbuffer%>]
		},
		yAxis: {
			title: {
				text: '中药使用前十名趋势统计'
			}
		},
		tooltip: {
			enabled: false,
			formatter: function() {
				return '<b>'+ this.series.name +'</b><br/>'+
					this.x +': '+ this.y +'°C';
			}
		},
		plotOptions: {
			line: {
				dataLabels: {
					enabled: true
				},
				enableMouseTracking: false
			}
		},
		series: [
<%if(null != datamap){
	Set dataset = datamap.entrySet();
    Iterator iter = dataset.iterator();
    int datasize = dataset.size();
    int i = 0;
    while(iter.hasNext()){
       i++;
       Entry entry = (Entry)iter.next();
       String herbname  = (String)entry.getKey();
       String datastr = (String)entry.getValue();
   %>
	{
	name: '<%=herbname%>',
	data: [<%=datastr%>]
    } 
	<%if(i<=datasize - 1){
		out.print(",");
	}%>
   <%}}%>
	]
	});
	
	
});
//-->
</script> 